package com.hdaccp.xingmu.controller;

import com.hdaccp.xingmu.dao.userdetailsDao;
import com.hdaccp.xingmu.entity.House;
import com.hdaccp.xingmu.entity.Userdetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

@Controller
@RequestMapping("/userdetails")
public class UserdetailsCon {
    @Autowired
    private userdetailsDao userdetailsDao;
    @Autowired
    private HouseCon houseCon;

    @RequestMapping("/ruzhu")
    @ResponseBody
    public Map<String,Object> ruzhu(long id, java.sql.Date date){
        Userdetails userdetails = userdetailsDao.findById(id).get();

        userdetails.setRundate(date);

        Userdetails userdetails1 = userdetailsDao.save(userdetails);

        return houseCon.list("-1",null,"-1","-1",1,15);
    }
}
